<?php
/**
 * Created by PhpStorm.
 * User: dapeng
 * Date: 2018/10/17
 * Time: 上午10:50
 */

namespace app\models\Project_1_0;
use Core\Model;

class Cases extends Model
{

    /**
     * 查询所有案件
     * @return mixed
     */
    function fetch_all(){
        $sql = "select  * from t_case;";
        return $this->db->fetch_sql($sql);
    }

    /**
     * 按条件查询
     * @param $option
     * @param $content
     * @return mixed
     */
    function search($option,$content){
        $sql = "select  * from t_case where $option like '%$content%' ";
        return $this->db->fetch_sql($sql);

    }
    //修改
    function edit($id)
    {
        $currDate=date('Y-m-d H:i:s',time());
        $sql="UPDATE t_case SET STATUS='已办结',finish_date='$currDate' WHERE c_id ='$id';";
        return $this->db->fetch_sql($sql);
    }


}